package com.zsummer.demo.cloudfeignconsumer;

import com.zsummer.demo.cloudfeignconsumer.feign.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication
@EnableFeignClients
public class CloudFeignConsumerApplication {

    public static void main(String[] args) {
        SpringApplication.run(CloudFeignConsumerApplication.class, args);
    }

    @RestController
    public class TestController {

        @Autowired
        private TestService testService;

        @GetMapping("/test")
        public String test() {
            return testService.hello();
        }
    }

}
